﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace SocketClient
{
    class GValues
    {
        private static string _dbpath = "C:\\erptestdll\\cadbom.db";
        private static string _configPath = "C:\\erptestdll\\config.txt";
        private static string _pdfPath = "c:\\plot2pdf2upload";
        private static Boolean _uploadComplete = true;
        private static int _uploadTimeCount = 6000;
        //private static string _dbpath = "cadbom.db";
        //private static string _configPath = "config.txt";
        private static bool _processFormClosed = true; //工序FORM控制变量
        public static int sharedValue { get; set; }
        public static String printName { get; set; }
        public static int scoketConnectKey { get; set; }
       
        public static string tenant { get; set; } //租户ID
        public static string productCode { get; set; } //产品代码
        public static string productCustCode { get; set; }//客户料号
        public static string token { get; set; } //登入TOKEN
        public static string loginLabelStatus { get; set; }
        public static string domainLink { get; set; }
        public static string domain { get; set; }
        public static string searchPath { get; set; }
        public static string globalUrl { get; set; }
        public static string account { get; set; } //用户
        public static string password { get; set; } //用户密码
        public static string cadHandleId { get; set; } //图纸表格句柄
        public static Boolean cancelCol { get; set; } //取消列

        public static string clickButtonText = ""; //命令按钮执行选择

        public static Boolean uploadComplete { get { return _uploadComplete; } set { _uploadComplete = value;} }
        public static int uploadTimeCount { get { return _uploadTimeCount; } set { _uploadTimeCount = value; } }
        public static string pdfPath
        {
            get { return _pdfPath; }
            set { _pdfPath = value; }
        }
        public static string configPath
        {
            get { return _configPath; }
            set { _configPath = value; }
        }
        public static bool processFormClosed
        {
            get { return _processFormClosed; }
            set { _processFormClosed = value; }
        }
        public static string dbpath
        {
            get { return _dbpath; }
            set
            {
                _dbpath = value;
            }
        }

    }

    #region 基础类
    public class OpmOutsourceProcessPage {

	
    public String id {get; set;}
    public String outsourceNo {get;set;}

    public String orderDate { get; set; }

    public String supplierId {get; set;}
    public String supplierId_dictText { get; set; }
    public String requestDate { get; set; }


    public String referenceNo {get;set;}

    public String referenceType {get;set;}

    public String contacts {get;set;}

    public String customerTell {get;set;}

    public String customerAddress {get;set;}

    public String currency {get;set;}

    public String amount {get;set;}

    public String qty {get;set;}

    public String qtyReceipt {get;set;}

    public String qtyReturn {get;set;}

    public String taxValue {get;set;}

	public String taxAmount {get;set;}

    public String remark {get;set;}

    public String attachment {get;set;}

    public String status {get;set;}

    public String createBy {get;set;}

    public String createTime { get; set; }

    public String updateBy {get;set;}

    public String updateTime { get; set; }

    public String approverId;
	public String outsourceType {get;set;}

    public BasSupplier supplier { get; set; }

    public BindingList<OpmOutsourceProcessItemPage> opmOutsourceProcessItemList;


}

    public class BasSupplier
    {
        public String id { get; set; }
        public String code { get; set; }
        public String name { get; set; }
        public String shortName { get; set; }
    }
    public class OpmOutsourceProcessItemPage  {


    public String id {get;set;}

    public String outsourceProcessId {get;set;}

    public String sequence {get;set;}

    public String processId {get;set;}
    public String custCode { get; set; }
    public String productName { get; set; }
    public String productCode { get; set; }
    public String description { get; set; }
    public String drawingNo { get; set; }
    public String productVer { get; set; }
    public String requirementAll { get; set; }
    public String requirementDescs { get; set; }
    public String requirements { get; set; }
    public String processId_dictText { get; set; }
    public String productId {get;set;}

    public String requestDate { get; set; }

    public String unitId {get;set;}
    public String unitId_dictText { get; set; }
	public String weight {get;set;}

	public String weightUnit {get;set;}

	public String area {get;set;}
    public String sizeWidth { get; set; }
    public String sizeLength { get; set; }
    public String widthUnit_dictText { get; set; }
    public String widthUnit { get; set; }
    public String weightUnit_dictText { get; set; }

	public String areaUnit {get;set;}
    public String areaUnit_dictText { get; set; }

    public String unitPrice {get;set;}
    public String taxValue { get; set; }
    public String taxAmount { get; set; }
    public String qty {get;set;}

    public String qtyReceipt {get;set;}

    public String supplierId_dictText { get; set; }
    public String qtyReturn {get;set;}

    public String amount {get;set;}

    public String remark {get;set;}

    public String createBy {get;set;}
    public String createBy_dictText { get; set; }
    public String createTime { get; set; }

    public String status { get; set; }

    public String status_dictText { get; set; }
    public String contacts { get; set; }

    public String contactsTell { get; set; }

    public String contactsAddress { get; set; }

    public String orderDate { get; set; }

}
    public class AppMessage
    {
        public String tenant { get; set; }
        public String value { get; set; }
        public String userUid { get; set; }
        public String username { get; set; }
        public String domain { get; set; }
        public String outsourceNo { get; set; }
        public String application { get; set; }
        public String password { get; set; }
    }
    public class MrpProcessBom
    {
        public String id { get; set; }
        public int processSeq { get; set; }
        public String processId { get; set; }
        public String processId_dictText { get; set; }
        public List<ProcessRequirements> processRequirements { get; set; }
        public String processRequirements_dictText { get; set; }
        public String processAttribute { get; set; }
        public String processAttribute_dictText { get; set; }
        public String equipments { get; set; }
        public String leadTime { get; set; }
        public String processTime { get; set; }
        public String piecePrice { get; set; }
        public String remark { get; set; }
        public String productId { get; set; }
        public String processRequirement { get; set; }



    }
    //public class ResponResult<T>
    //{
    //    public Boolean success { get; set; }
    //    public string message { get; set; }
    //    public int code { get; set; }
    //    public T result { get; set; }
    //}
    public class TestData
    {
        public String id { get; set; }
    }
    public class ResponResultA<T>
    {
        public Boolean success { get; set; }
        public string message { get; set; }
        public int code { get; set; }
        public RetData<T> result { get; set; }
    }

    public class ResponResultB<T>
    {
        public Boolean success { get; set; }
        public string message { get; set; }
        public int code { get; set; }
        public BindingList<T> result { get; set; }
    }

    public class ResponResultC<T>
    {
        public Boolean success { get; set; }
        public string message { get; set; }
        public int code { get; set; }
        public T result { get; set; }
    }
    public class RetData<T>
    {
        public BindingList<T> records { get; set; }
        public int total { get; set; }
        public int size { get; set; }
        public int curren { get; set; }
        public int pages { get; set; }
    }

    public class BasProcess
    {
        public String id { get; set; }
        public String name { get; set; }
        public String processType { get; set; }

        public String attribute { get; set; }
        public List<BasProcessRequirement> processRequirements;
    }
    public class BasProcessRequirement
    {
        public String id { get; set; }
        public String name { get; set; }
        public String processId { get; set; }
    }

    public class ProcessAttribute
    {
        public ProcessAttribute(String _id, String _name)
        {
            id = _id;
            name = _name;
        }
        public String id { get; set; }
        public String name { get; set; }
    }
    public class ProcessRequirements
    {
        public String id { get; set; }
        public String name { get; set; }
    }
    public class LoginDTO
    {
        public UserInfo userInfo { get; set; }
        public List<Object> tenantList { get; set; }
        public string token { get; set; }
    }
    public class UserInfo
    {
        string username { get; set; }
        string realname { get; set; }

    }
    public class BasProduct
    {

        public String id { get; set; }

        public String custId_dictText;
        public String productType_dictText { get; set; }
        public String code { get; set; }
        public String custCode { get; set; }
        public String drawingNo { get; set; }
        public String name { get; set; }
        public String productVer { get; set; }
        public String unitId_dictText { get; set; }

        public String productionMethod { get; set; }

        public String productionMethod_dictText { get; set; }
        public String stage_dictText { get; set; }
        public String description { get; set; }
        public String remark { get; set; }
        public String weight { get; set; }
        public String weightUnit { get; set; }
        public String weightUnit_dictText { get; set; }
        public String sizeLength { get; set; }
        public String sizeWidth { get; set; }
        public String widthUnit { get; set; }
        public String widthUnit_dictText { get; set; }
        public String cadHandleId { get; set; }
        public String attachment { get; set; }

    }
    public class ResponResult<T>
    {
        public Boolean success { get; set; }
        public string message { get; set; }
        public int code { get; set; }
        public T result { get; set; }
    }
    public static class BindingListExtensions
    {
        public static void Sort<T>(this BindingList<T> bindingList, Func<T, object> sortBy)
        {
            var sortedList = bindingList.OrderBy(sortBy).ToList();
            bindingList.Clear();
            foreach (var item in sortedList)
            {
                bindingList.Add(item);
            }
        }
    }

    public class WomWorkOrderItemPage
    {
        public String workOrderNumber { get; set; }
        public String qty { get; set; }
        public String requestDate { get; set; }
        public String code { get; set; }

        public List<WomWorkOrderItemPage> itemChilds;
    }

    #endregion
}
